package com.virtium.vpm.dao.hibernate;

import com.virtium.vpm.dao.DAOFactory;
import com.virtium.vpm.dao.MajorTaskDAO;
import com.virtium.vpm.dao.ProjectDAO;
import com.virtium.vpm.dao.TypeDAO;
import com.virtium.vpm.dao.UserDAO;






/**
 * Returns Hibernate-specific instances of DAOs.
 * <p/>
 * One of the responsiblities of the factory is to inject a Hibernate Session
 * into the DAOs. You can customize the getCurrentSession() method if you
 * are not using the default strategy, which simply delegates to
 * Hibernates built-in "current Session" mechanism. This factory uses
 * HibernateUtil to get access to the SessionFactory.
 * <p/>
 * If for a particular DAO there is no additional non-CRUD functionality, we use
 * a nested static class to implement the interface in a generic way. This allows clean
 * refactoring later on, should the interface implement business data access
 * methods at some later time. Then, we would externalize the implementation into
 * its own first-level class.
 *
 * @author TuanAnh
 */
public class HibernateDAOFactory extends DAOFactory {

	
	public TypeDAO getTypeDAO() {		
		return new TypeDAOHibernate();
	}	
   
	public UserDAO getUserDAO() {		
		return new UserDAOHibernate();
	}
   
	public ProjectDAO getProjectDAO() {		
		return new ProjectDAOHibernate();
	}
	public MajorTaskDAO getMajorTaskDAO() {		
		return new MajorTaskDAOHibernate();
	}
	
}
